﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CalcLibrary;
using CalcLibrary.Model;

namespace CsplCalculator
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 };
            //IList<int> eventNumbers = new List<int>();
            //for (int i = 0; i < numbers.Length; i++)
            //{

            //    if (numbers[i] % 2 == 0)
            //    {
            //        eventNumbers.Add(numbers[i]);
            //    }
            //}

            //var eventNumbers_2 =
            //    from nomor in numbers
            //    where (nomor % 2) == 0
            //    select nomor;

            var eventNumbers_2 = numbers.Where(num => num % 2 == 0);

            foreach (int num in eventNumbers_2)
            {
                Console.Write("{0,1}", num);
            }

            //static bool EvenNumberCheck(int numbers)
            //{
            //    return numbers % 2 ==0;
            //}

            //MainCalculator calculator = new MainCalculator();
            //CalcModel data1 = new CalcModel() { IntegerValue1 = 20, IntegerValue2 = 14, Operation = CalOperation.Add };
            //CalcModel data2 = new CalcModel(CalOperation.Div) ;

            //data1.ListOfIntegerValue = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            //data1.Operation = CalOperation.Add;
            //data1.Mode = CalMode.List;

            ////data1.IntegerValue1 = 20;
            ////data1.IntegerValue2 = 14;
            ////data1.Operation = CalOperation.Add;

            //calculator.Data = data1;

            //try
            //{
            //    int result = calculator.Calculate();
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine("An exception occured : "+ex.Message);
            //}
        }
    }
}
